package com.example.view;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Risky57 on 2017/4/28.
 */

public class View {

    private List<OnClickListener> listeners = new ArrayList<>();

    public void performClick(){
        for (OnClickListener listener : listeners) {
            listener.onClick(this);
        }
    }


    public void addOnClickListener (OnClickListener onClickListener) {
        listeners.add(onClickListener);
    }

    public interface OnClickListener{
        void onClick(View view);
    }
}
